﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using VSTOEE90;
using Microsoft.Office.Core;

namespace helpcarla
{
    class AttClass
    {
        //public System.Net.Mail.Attachment sendAttach()
        //{
            /*
            System.Net.Mail.Attachment attach = new Attachment();
            attach.Name = "Carla Rechtzigel's Medical Info";
            Type wordType = Type.GetTypeFromProgID("Word.Application");

            object wordApplication = Activator.CreateInstance(wordType);
            wordType.InvokeMember("Visible", BindingFlags.SetProperty, null, wordApplication, new object[] { false });

            object wordDocuments = wordType.InvokeMember("Documents", BindingFlags.GetProperty, null, wordApplication, new object[] { });
            object wordDocument = wordType.InvokeMember("Open", BindingFlags.InvokeMethod, null, wordDocuments, new object[] { fileName });
            object activeWindow = wordDocument.GetType().InvokeMember("ActiveWindow", BindingFlags.GetProperty, null, wordDocument, null);
            object selection = activeWindow.GetType().InvokeMember("Selection", BindingFlags.GetProperty, null, activeWindow, null);

            selection.GetType().InvokeMember("WholeStory", BindingFlags.InvokeMethod, null, selection, null);
            selection.GetType().InvokeMember("Copy", BindingFlags.InvokeMethod, null, selection, null);
            wordDocument.GetType().InvokeMember("Close", BindingFlags.InvokeMethod, null, wordDocument, null);
            wordApplication.GetType().InvokeMember("Quit", BindingFlags.InvokeMethod, null, wordApplication, null);

            IDataObject data = Clipboard.GetDataObject();
            string text = data.GetData(DataFormats.Text).ToString();

            richTextBox1.Text = text;    // text contains required data 
             */
        //}
    }
}
